/**
 * 导航菜单模型 
 * 
*/
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("menus", {
        id: {
            type: Sequelize.INTEGER,
            comment: '主键',
            notNull: true,
            primaryKey: true,
            autoIncrement: true, // 自增整形主键
        },
        parentId: {
            type: Sequelize.INTEGER,
            comment: '父级id',
            field:'parent_id'
        },
        type: {
            type: Sequelize.INTEGER,
            comment: '菜单类型'
        },
        path: {
            type: Sequelize.STRING,
            comment: '菜单路径',
        },
        component: {
            type: Sequelize.STRING,
            comment: '组件路径',
        },
        title: {
            type: Sequelize.STRING,
            comment: '菜单标题',
        },
        perms: {
            type: Sequelize.STRING,
            comment: '权限标识'
        },
        icon: {
            type: Sequelize.STRING,
            comment: '菜单图标',
        },
        sort: {
            type: Sequelize.INTEGER,
            comment: '显示排序',
        },
        state: {
            type: Sequelize.BOOLEAN,
            comment: '菜单状态',
            defaultValue: true
        },
        showState: {
            type: Sequelize.BOOLEAN,
            comment: '显示状态',
            defaultValue: true,
            field:'show_state'
        },
        cache: {
            type: Sequelize.BOOLEAN,
            comment: '缓存',
            defaultValue: true,
        },
        externalLink: {
            type: Sequelize.BOOLEAN,
            comment: '是否外链',
            defaultValue: false,
            field:'external_link'
        }
    })
}